package Shopping;

public class Goods {
    //商品属性：名称、种类、价格、数量
    private String name;
    private String kind;
    private int price;
    private int quantity;
    public Goods() {}
    public Goods(String name, String kind, int price, int quantity) {
        this.name = name;
        this.kind = kind;
        this.price = price;
        this.quantity = quantity;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getKind() {
        return kind;
    }
    public void setKind(String kind) {
        this.kind = kind;
    }
    public int getPrice() {
        return price;
    }
    public void setPrice(int price) {
        this.price = price;
    }
    public int getQuantity() {
        return quantity;
    }
    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }
    //定义一个展示商品的方法
    public void print() {
        System.out.println("商品名称:"+getName()+","+"商品价格："+getPrice()+","+
                "商品数量："+getQuantity());
    }




}
